package com.cos.lession72.services.impl;

import com.cos.lession72.dao.EmpMapper;
import com.cos.lession72.entity.Emp;
import com.cos.lession72.services.EmpServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author: COS
 * @time: 2022/9/28 9:20
 * @description:
 */
@Transactional
@Service("es")
public class EmpServicesImpl implements EmpServices {
    @Autowired
    private EmpMapper empMapper;
    @Transactional(readOnly = true,propagation = Propagation.SUPPORTS)
    @Override
    public List<Emp> getAll() {
        System.out.println(10/0);
        System.out.println("不敲代码的人,脑子有问题");
        return empMapper.getAll();
    }
}
